<?php

class QrController extends Controller
{
	public function actionIndex()
	{
		$this->render('index');
	}

	public function actionList()
	{
		$cs = Yii::app()->getClientScript();
		$cs->registerCoreScript('jquery');
		$this->render('list');
	}

	public function actionUserCode($id = null)
	{
		if ($id == null)
			$id = Yii::app()->user->id;
		else
			$id = (int)$id;
		$data = array(
			'user_id'=>$id,
			);
		QR::png_encrypted(CJSON::encode($data));
	}
}